Skip to content

Initialize blacklist_path_length #9129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 25, 2022

For some reason, GCC warns[1]:

| ‘blacklist_path_length’ may be used uninitialized in this function
| [-Werror=maybe-uninitialized]

This looks like a false positive to me, but it doesn't hurt to
explicitly initialize the variable.

[1] https://github.com/php/php-src/runs/7502212969?check_suite_focus=true

cmb69 added 2 commits July 25, 2022 18:03
For some reason, GCC warns[1]:

| ‘blacklist_path_length’ may be used uninitialized in this function
| [-Werror=maybe-uninitialized]

This looks like a false positive to me, but it doesn't hurt to
explicitly initialize the variable.

[1] <https://github.com/php/php-src/runs/7502212969?check_suite_focus=true>
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is a false positive and I agree with the change.

@cmb69 cmb69 closed this in 7d36703 Jul 25, 2022
@cmb69 cmb69 deleted the cmb/initialize-blacklist_path_length branch July 25, 2022 17:16
cmb69 referenced this pull request Jul 25, 2022
If the blacklist file contains a line with a single double-quote, we
called `zend_strndup(pbuf, -1)` what causes an unnecessary bail out;
instead we just ignore that line.

If the blacklist file contains an empty line, we may have caused an OOB
read; instead we just ignore that line.

Closes GH-9036.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants